package com.huajin.codetest.stream;

import java.util.stream.Stream;

/**
 * https://my.oschina.net/u/5079097/blog/5291463
 *
 * @author hongwei.lian
 * @date 2021年11月2日 上午9:33:45
 */
public class StreamApi {
	
	public void generateStream() {
		//-- 无限流
		Stream<Double> generate = Stream.generate(Math::random);
		Stream<Integer> iterate = Stream.iterate(0, t -> t + 5);
		System.out.println(generate);
		System.out.println(iterate);
	}

}
